Skip to content

docs: Add AI Button - #11068

Merged
devongovett merged 2 commits into
mainfrom
ai-button-docs
Dec 2, 2026
Merged

devongovett merged 2 commits into
mainfrom
ai-button-docs

Conversation

@snowystinger

Copy link
Copy Markdown
Member

Adds the AI Button to our AI Guide docs.

@rspbot

rspbot commented Dec 1, 2026

Copy link
Copy Markdown

reidbarber
reidbarber previously approved these changes Dec 1, 2026
importSource="@react-spectrum/ai"
type="s2" />

### Icon only

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we handle the icon only example like we do in the S2 button docs using the controls?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so the reason I did it this way was because the label has to disappear entirely, undefined, but technically we should still have an aria-label, which I didn't want to put in the jsx of the rendered code with some random string we chose.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

our example in S2 Button also ends up with an unlabeled example if you make it icon only :-/

@rspbot

rspbot commented Dec 2, 2026

Copy link
Copy Markdown

@rspbot

rspbot commented Dec 2, 2026

Copy link
Copy Markdown
## API Changes

@react-spectrum/ai

/@react-spectrum/ai:AIButton

 AIButton {
   aria-controls?: string
   aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
   aria-describedby?: string
   aria-details?: string
   aria-disabled?: boolean | 'true' | 'false'
   aria-expanded?: boolean | 'true' | 'false'
   aria-haspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
   aria-label?: string
   aria-labelledby?: string
   aria-pressed?: boolean | 'true' | 'false' | 'mixed'
   autoFocus?: boolean
-  brandColor?: string
   children?: string
   excludeFromTabOrder?: boolean
   form?: string
   formAction?: ButtonHTMLAttributes<HTMLButtonElement>['formAction']
   formEncType?: string
   formMethod?: string
   formNoValidate?: boolean
   formTarget?: string
   id?: string
   isDisabled?: boolean
   name?: string
   onBlur?: (FocusEvent<Target>) => void
   onFocus?: (FocusEvent<Target>) => void
   onFocusChange?: (boolean) => void
   onKeyDown?: (KeyboardEvent) => void
   onKeyUp?: (KeyboardEvent) => void
   onPress?: (PressEvent) => void
   onPressChange?: (boolean) => void
   onPressEnd?: (PressEvent) => void
   onPressStart?: (PressEvent) => void
   onPressUp?: (PressEvent) => void
   preventFocusOnPress?: boolean
-  size?: 'S' | 'M' | 'L' | 'XL'
+  size?: 'S' | 'M' | 'L' | 'XL' = 'M'
   slot?: string | null
   type?: 'button' | 'submit' | 'reset' = 'button'
   value?: string
 }

/@react-spectrum/ai:AIButtonProps

 AIButtonProps {
   aria-controls?: string
   aria-current?: boolean | 'true' | 'false' | 'page' | 'step' | 'location' | 'date' | 'time'
   aria-describedby?: string
   aria-details?: string
   aria-disabled?: boolean | 'true' | 'false'
   aria-expanded?: boolean | 'true' | 'false'
   aria-haspopup?: boolean | 'menu' | 'listbox' | 'tree' | 'grid' | 'dialog' | 'true' | 'false'
   aria-label?: string
   aria-labelledby?: string
   aria-pressed?: boolean | 'true' | 'false' | 'mixed'
   autoFocus?: boolean
-  brandColor?: string
   children?: string
   excludeFromTabOrder?: boolean
   form?: string
   formAction?: ButtonHTMLAttributes<HTMLButtonElement>['formAction']
   formEncType?: string
   formMethod?: string
   formNoValidate?: boolean
   formTarget?: string
   id?: string
   isDisabled?: boolean
   name?: string
   onBlur?: (FocusEvent<Target>) => void
   onFocus?: (FocusEvent<Target>) => void
   onFocusChange?: (boolean) => void
   onKeyDown?: (KeyboardEvent) => void
   onKeyUp?: (KeyboardEvent) => void
   onPress?: (PressEvent) => void
   onPressChange?: (boolean) => void
   onPressEnd?: (PressEvent) => void
   onPressStart?: (PressEvent) => void
   onPressUp?: (PressEvent) => void
   preventFocusOnPress?: boolean
-  size?: 'S' | 'M' | 'L' | 'XL'
+  size?: 'S' | 'M' | 'L' | 'XL' = 'M'
   slot?: string | null
   type?: 'button' | 'submit' | 'reset' = 'button'
   value?: string
 }

@rspbot

rspbot commented Dec 2, 2026

Copy link
Copy Markdown

Agent Skills Changes

Modified (10)
Install

React Spectrum S2:

npx skills add https://d1pzu54gtk2aed.cloudfront.net/pr/d504fca07264ca16d9c4a327a1e58749b9d78b92/

React Aria:

npx skills add https://d5iwopk28bdhl.cloudfront.net/pr/d504fca07264ca16d9c4a327a1e58749b9d78b92/

@devongovett
devongovett added this pull request to the merge queue Dec 2, 2026
Merged via the queue into main with commit 39b4371 Dec 2, 2026
31 checks passed
@devongovett
devongovett deleted the ai-button-docs branch December 2, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants